#ifndef UPGRADESELECTDIALOG_H
#define UPGRADESELECTDIALOG_H

#include <QDialog>

namespace Ui {
class MotorCalibDialog;
}

class QTimer;
struct HostReply;
class MotorCalibDialog : public QDialog
{
    Q_OBJECT
public:
    explicit MotorCalibDialog(QWidget *parent = Q_NULLPTR);
    ~MotorCalibDialog();

    void show(bool forceCalib = false);

private slots:
    void on_btnOK_clicked();
    void on_btnClose_clicked();
    void on_btnCalib_clicked();
    void onMotorCalibDone(const HostReply &host);

private:
    void releaseMotor();
    void finished(bool success);
    void setCloseButtonVisible(bool show);
    void changePage(int index);
    void rotateImage();
    void initWidget();

private:
    Ui::MotorCalibDialog *ui;
    QTimer *m_timer;
    QPixmap m_pixmap;
    int m_counter;
    int m_angle;
    bool m_forceCalib;
    bool m_success;
};

#endif // UPGRADESELECTDIALOG_H
